<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1">
    <meta http-equiv="X-UA-Compatible" content="IE=9"/>
    <meta name="renderer" content="webkit">
    <title>员工信息读入</title>
    <link rel="stylesheet" type="text/css" href="../../css/cm-default.css"/>
    <link rel="stylesheet" type="text/css" href="../../lib/ligerUI/skins/Aqua/css/ligerui-all.css"/>
    <link rel="stylesheet" type="text/css" href="../../lib/ligerUI/skins/Gray2014/css/all.css"/>
    <link rel="stylesheet" type="text/css" href="../../lib/select2/css/select2.css" />
    <link rel="stylesheet" type="text/css" href="../../lib/ligerUI/skins/ligerui-icons.css"/>
    <link rel="stylesheet" type="text/css" href="../../lib/bootstrap/css/bootstrap.css"/>
    <link type="text/css" rel="stylesheet" href="../../css/public.css"/>
    <link type="text/css" rel="stylesheet" href="../../css/pub.css"/>
    <script src="../../lib/jquery/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script src="../../lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
    <script src="../../lib/autoInput/AutoInput.js" type="text/javascript"></script>
    <script src="../../lib/bootstrap/js/bootstrap.js" type="text/javascript"></script>
	<script src="../../lib/select2/js/select2.full.js" type="text/javascript"></script>
    <script src="../../js/pub.js" type="text/javascript"></script>
    <script src="../../js/comkey.js" type="text/javascript"></script>
    <script src="../../js/common.js" type="text/javascript"></script>
    <script src="employee_new.js" type="text/javascript"></script>
</head>
<body>
<div class="form_tab contextHeight">
    <div id="form_option" class="contextWidth form_option">
        <div class="contextWidth form_option_content">
        <table><tr><td><span id="ReadResult" name="ReadResult" style="color: #0000FF"></span></td></tr></table>
        	<button type="button" onclick="return ReadIDCard()" id = "readsfz"
                    class="form_Button btn btn-primary btn-xs">读身份证
            </button>
            <button type="button" onclick="saveUser()" id = "saveuser"
                    class="form_Button btn btn-primary btn-xs">建档采集人脸开始
            </button>
            <button type="button" onclick="loadUser()" id = "loaduser"
                    class="form_Button btn btn-primary btn-xs">建档采集人脸完成
            </button>
            <button type="button" onclick="setAttend()" id = "setattend"
                    class="form_Button btn btn-primary btn-xs">设置考勤
            </button>
        </div>
    </div>
    <div id="form_core" class="form_core">
        <div id="formContent" class="formContent">
            <div class="form_core_content">
                <div id="a_center">
                    <form class="form-horizontal label_font" name="basic-form"
                          method="post" id="basic_form" data-validate="{}">
                        <div class="form-group">
                            <label for="userid" class="col-sm-1 control-label">员工编号</label>
                            <div class="col-sm-3">
                                <input type="text" name="userid" id="userid"
                                       class="form-control input-sm readonly" readonly="readonly">
                            </div>
                        </div>
                        <div class="row-fluid" style="width:90%;margin:auto;">
                            <div class="span2" style="width: 30%;float: left">
                                <div class="form-group">
                                    <div class="col-sm-7 col-sm-offset-2" class="input_left_line">
                                        <!-- <img id="image" alt="120x150" src="C:/sfzzp.jpeg" class="img-rounded" width="120" height="150"/> -->
                                        <OBJECT classid="clsid:10946843-7507-44FE-ACE8-2B3483D179B7" codebase="CVR100.cab#version=3,0,3,3" 
								      			id="CVR_IDCard" name="CVR_IDCard" width=119 height=136 align=center hspace=0 vspace=0>
									    </OBJECT>
                                    </div>
                                </div>
                            </div>
                            <div class="span10" style="width: 70%;float: left;">
                                <div class="form-group">
                                    <label for="name" class="col-sm-1 control-label" style="font:bold;">姓名</label>
                                    <div class="col-sm-6">
                                    <label class="style_mx_label style_mx_text_left" id="name"></label>
                                    </div>
                                 </div>
                                 <div class="form-group">
                                    <label for="sex" class="col-sm-1 control-label">性别</label>
                                    <div class="col-sm-3">
                                    <label class="style_mx_label style_mx_text_left" id="sex"></label>
                                    </div>
                                    <label for="nation" class="col-sm-1 control-label">民族</label>
                                    <div class="col-sm-3">
                                    <label class="style_mx_label style_mx_text_left" id="nation"></label>
                                    <input type="hidden" name="PhotoPath" id="PhotoPath" value="C:\" size="20" />
                                    </div>
                                </div>
                               <div class="form-group">
                                    <label for="birthday" class="col-sm-1 control-label">出生</label>
                                    <div class="col-sm-7">
                                    <label class="style_mx_label style_mx_text_left" id="birthday"></label>
                                    </div>
                                </div>
                               <div class="form-group">
                                    <label for="address" class="col-sm-1 control-label">地址</label>
                                    <div class="col-sm-7">
                                    <label class="style_mx_label style_mx_text_left" id="address"></label>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="ssn" class="col-sm-1 control-label">身份证</label>
                                    <div class="col-sm-7">
                                     <label class="style_mx_label style_mx_text_left" id="ssn"></label>
                                     <input type="hidden"  name="image" id="image" />
                                    </div>
                               </div>
                            </div>
                        </div>
                        <div class="form-group">
                                    <label for="company_id" class="col-sm-1 control-label">公司</label>
                                    <div class="col-sm-3">
                                    <select id ="company_id"> </select>
                                    </div>
                                    <label for="dept_id" class="col-sm-1 control-label">部门</label>
                                    <div class="col-sm-3">
                                    <select id ="dept_id"> </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="mobile_phone" class="col-sm-1 control-label">手机</label>
                                    <div class="col-sm-3">
                                        <input type="text" name="mobile_phone" id="mobile_phone" placeholder="手机"
                                               data-toggle="tooltip" data-placement="right"
                                               class="form-control input-sm">
                                    </div>
                                    <label for="fix_phone" class="col-sm-1 control-label">电话</label>
                                    <div class="col-sm-3">
                                        <input type="text" name="fix_phone" id="fix_phone" placeholder="电话"
                                               data-toggle="tooltip" data-placement="right"
                                               class="form-control input-sm">
                                    </div>
                                </div>
                    </form>
                </div>
                <br/>

                <div>
                    <!-- Nav tabs -->
                    <ul class="nav nav-tabs" role="tablist">
                        <li role="presentation" class="active"><a href="#tab1"
                                                                  aria-controls="tab1" role="tab" data-toggle="tab"
                                                                  aria-expanded="true">考勤设备设置</a></li>
                    </ul>
                    <!-- Tab panes -->
                    <div class="tab-content">
                        <div role="tabpanel" class="tab-pane tab_content active"
                             id="tab1">
                            <div class="form-horizontal">
                                <div class="form-group">
                                    <label for="gatMachineNum" class="col-sm-1 control-label">采集设备号</label>

                                    <div class="col-sm-3 col-sm-offset-1">
                                        <select id="gatMachineNum">
                                        </select>
                                    </div>
                                    <label for="MachineNum" class="col-sm-1 control-label">考勤设备号</label>

                                    <div class="col-sm-3 col-sm-offset-1">
                                        <select id="MachineNum">
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <br/>
        </div>
    </div>
</div>
<div>
      <applet archive="../attendance/ZKFace.jar" code = "com.app.FaceApplet"
	  	name = "faceApplet" id="faceApplet" height="0" width= "0" hspace= "0" vspace = "0"
	 	 align = "middle">
      </applet>
</div>
</body>
<script type="text/javascript">
//window.onbeforeunload=DoStopRead;
window.onload=function(){
	HideActiveX();
}
function HideActiveX() {
	//document.getElementById("CVR_IDCard").Visible=false; 
	ClearIDCard();
	ClearForm();
	document.getElementById('ReadResult').value = "等待验证";
	return true;
}
function ReadIDCard() {
	document.getElementById("CVR_IDCard").PhotoPath = document.getElementById('PhotoPath').value;
	document.getElementById("CVR_IDCard").TimeOut = 3;
	ClearIDCard();
	ClearForm();
	document.getElementById('ReadResult').value = "请放卡...";
	var strReadResult = document.getElementById("CVR_IDCard").ReadCard;
	FillForm();
	document.getElementById('ReadResult').value = "返回值:" + strReadResult;
	$("#readsfz").attr('disabled',true);
    $("#saveuser").attr('disabled',false);
    $("#loaduser").attr('disabled',true);
    $("#setattend").attr('disabled',true);
	return true;
}
function ClearIDCard() {
	document.getElementById("CVR_IDCard").Name = "";
	document.getElementById("CVR_IDCard").NameL = "";
	document.getElementById("CVR_IDCard").Sex = "";
	document.getElementById("CVR_IDCard").Nation = "";
	document.getElementById("CVR_IDCard").Born = "";
	document.getElementById("CVR_IDCard").Address = "";
	document.getElementById("CVR_IDCard").CardNo = "";
	document.getElementById("CVR_IDCard").Police = "";
	document.getElementById("CVR_IDCard").Activity = "";
	document.getElementById("CVR_IDCard").NewAddr = "";
	return true;
}
function ClearForm() {
	$("#name").html("");
	$("#sex").html("");
	$("#nation").html("");
	$("#birthday").html("");
	$("#address").html("");
	$("#ssn").html("");
	$("#image").html("");
	return true;
}
function FillForm() {
	var pName = document.getElementById("CVR_IDCard").NameL; 
	var pSex = document.getElementById("CVR_IDCard").SexL;
	var pNation = document.getElementById("CVR_IDCard").NationL; 
	var pBorn = document.getElementById("CVR_IDCard").BornL; 
	var pAddress = document.getElementById("CVR_IDCard").Address;
	var pCardNo = document.getElementById("CVR_IDCard").CardNo;
	var pPolice = document.getElementById("CVR_IDCard").Police;
	var pActivity = document.getElementById("CVR_IDCard").Activity;
	var pNewAddr = document.getElementById("CVR_IDCard").NewAddr;
	var pActivityLFrom = document.getElementById("CVR_IDCard").ActivityLFrom;
	var pActivityLTo = document.getElementById("CVR_IDCard").ActivityLTo;
	var pPhotoBuffer = document.getElementById("CVR_IDCard").GetPhotoBuffer;
	$("#name").html(pName);
	$("#sex").html(pSex); 
	$("#nation").html(pNation);
	$("#birthday").html(pBorn);
	$("#address").html(pAddress);
	$("#ssn").html(pCardNo);
	document.getElementById("image").value = pPhotoBuffer;
	//显示照片Servlet
	return true;
}
</script>
</html>


